<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Service extends Authenticated{
	
	function __construct() {
		parent::__construct();
		$this->load->model("service_model");
                $this->load->model("fungsi_model");
	}
	
	function index(){
		$this->list_service() ;
	}
	
        function list_service()
        {
            $data['list_service']=$this->service_model->get_all_service();
            $this->load->view('header');
            $this->load->view('service/list_service',$data);
            $this->load->view('footer');
        }
        
        function add_service()
        {
            $this->load->view('header');
            $this->load->view('service/add_service');
            $this->load->view('footer');
        }
        
        function add_service_process()
        {
            $data = $_GET;
            $this->service_model->add_service($data);
            redirect(SERVICE);
        }
        
        function edit_service($id)
        {
            $data = $this->service_model->get_service($id);
            $this->load->view('header');
            $this->load->view('service/form_edit_service',$data);
            $this->load->view('footer');
        }
        
        function edit_service_process()
        {
            $data = $_GET;
            $this->service_model->update_service($data);
            redirect(SERVICE);
        }
        
        function delete_service($id)
        {
            $this->service_model->delete_service($id);
            redirect(SERVICE);
        }
	
}
/** End of file */
